#include "updatearticlecontentrequest.h"
#include "updatearticlecontentresponse.h"
#include "newspaper/article.h"
//#include <json.h>

#include <QTextStream>
#include <QVariant>
#include <QDebug>
#include <QUrl>

UpdateArticleContentRequest::UpdateArticleContentRequest(Article* article, QObject *parent) :
    Network::GetJSONRequest(parent),
    m_response(new UpdateArticleContentResponse(article)),
    m_article(article)

{
}

Network::JSONResponse &UpdateArticleContentRequest::jsonResponse()
{
    return *m_response;
}

const Network::JSONResponse &UpdateArticleContentRequest::jsonResponse() const
{
    return *m_response;
}

QUrl UpdateArticleContentRequest::url() const
{
    QString url = QString("http://newsreader2.me.zing.vn/mrm/ver2/article?method=get_article_info&uid=%1&lid=%2&includecontent=true")
            .arg(1) .arg(m_article->getId());
    return QUrl(url);
}
